package com.xywy.fwc.paser;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.xywy.fwc.bean.FwcActivityBean;
import com.xywy.fwc.bean.FwcAssea;
import com.xywy.fwc.net.BaseParser;

public class FwcActivityParser extends BaseParser<List<FwcActivityBean>> {

	@Override
	public List<FwcActivityBean> parseJson(String result) {
		List<FwcActivityBean> activity_beans = new ArrayList<FwcActivityBean>();
		try {
			Gson gson = new Gson();
			JSONObject json = new JSONObject(result);
			JSONArray data = json.optJSONArray("data");
			activity_beans = gson.fromJson(data.toString(),  new TypeToken<List<FwcActivityBean>>(){}.getType());
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		return activity_beans;
	}

}
